package com.example.mybatis_plus_use.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 商品分类表 实体类
 * </p>
 *
 * @author zjh
 * @since 2025-01-16
 */
@Data
@TableName("category")
public class Category {

    @Schema(description = "分类ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "分类名称")
    @TableField("name")
    private String name;

    @Schema(description = "父分类ID")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "分类层级：1-一级分类，2-二级分类，3-三级分类")
    @TableField("level")
    private Integer level;

    @Schema(description = "排序字段")
    @TableField("sort")
    private Integer sort = 0;  // 默认值0

    @Schema(description = "状态：0-禁用，1-启用")
    @TableField("status")
    private Integer status = 1;  // 默认值1
}
